package demo2;

class Animal {
    public int age;
    public String name;
    public void fun () {
        System.out.println("Animal 的 fun()方法");
    }
     static final int add (int a, int b) {
        return a - b;
    }

}

class Cat extends Animal{
    @Override
     public void fun() {
        System.out.println("Cat 的 fun() 方法");
    }
     public void eat () {
        System.out.println("吃猫粮!!");
    }
     int add (int a, int b, int c) {
        return a + b + c;
    }

}
class Dog extends Animal{
    @Override
    public void fun() {
        System.out.println("Dog 的 fun() 方法");
    }
    public void swing () {
        System.out.println("小狗在游泳 !!");
    }
}
public class Test {
    public static void main(String[] args) {
        Cat animal = new Cat();
        animal.add(1,1);
    }
}
